﻿<%@ Page Language="C#" AutoEventWireup="true"Title="Vehicles | QuickWheelz" MasterPageFile="~/quickwheels.master" CodeFile="Vehicles.aspx.cs" Inherits="Vehicles" %>


<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="headerPlaceHolder">
    
</asp:Content>

<asp:Content ID="Content4" runat="server" ContentPlaceHolderID="menubarPlaceHolder">
</asp:Content>
    
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="bodyPlaceHolder">

    <asp:ObjectDataSource ID="quickWheelzObjectDataSource" runat="server" TypeName="quickwheelz" SelectMethod="getVehicles" DeleteMethod="deleteVehicle"
    UpdateMethod="updateVehicle">
        <UpdateParameters>
            <asp:Parameter Name="vinId" Type="String" ConvertEmptyStringToNull="true"/>
            <asp:Parameter Name="make" Type="String" ConvertEmptyStringToNull="true"/>
            <asp:Parameter Name="model" Type="String" ConvertEmptyStringToNull="true"/>
            <asp:Parameter Name="manYear" Type="Int32" ConvertEmptyStringToNull="true"/>
             <asp:Parameter Name="colour" Type="String" ConvertEmptyStringToNull="true"/>
        </UpdateParameters>
    </asp:ObjectDataSource>

    <div class="grid_view_div">

        <asp:GridView ID="vehicleGridView" runat="server" AutoGenerateColumns="False" DataSourceID="quickWheelzObjectDataSource" AllowPaging="true" AllowSorting="true"
            EnableModelValidation="True" BackColor="White" BorderColor="#999999" 
            BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" 
            DataKeyNames="vinId" DataMember="DefaultView" OnSelectedIndexChanged ="vehicleGridViewSelectedIndexChange"
            ShowFooter="True">
            <AlternatingRowStyle BackColor="#DCDCDC" />
            <Columns>
                <asp:BoundField DataField="vinId" HeaderText="Vin Number" ReadOnly="true"/>
                <asp:BoundField DataField="make" HeaderText="Vehicle Make" ReadOnly="false"/>
                <asp:BoundField DataField="model" HeaderText="Vehicle Model" ReadOnly="false"/> 
                <asp:CommandField ButtonType="Image" ShowEditButton="True" CancelImageUrl="~/images/icons/cancel.png" UpdateImageUrl="~/images/icons/save.png" EditImageUrl="~/images/icons/edit.png" />    
                <asp:CommandField ButtonType="Image" ShowSelectButton="True" SelectImageUrl="~/images/icons/viewDetail.png"/>    
            </Columns>
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
            <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
            <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
        </asp:GridView>

        <br />

    </div>

    <div class="">
        <asp:DetailsView ID="vehicleRentalDetailsView" runat="server" AutoGenerateRows="false" DataKeyNames="vinId">
            <HeaderTemplate><asp:Label ID="lblFormHEader" runat="server" Text="Vehicle Current Rental Info"></asp:Label></HeaderTemplate>
            <Fields>
                <asp:BoundField DataField="vinId" HeaderText="Vin Number" ReadOnly="true"/>
                <asp:BoundField DataField="make" HeaderText="Vehicle Make" ReadOnly="true"/>
                <asp:BoundField DataField="model" HeaderText="Vehicle Model" ReadOnly="true"/> 
                <asp:BoundField DataField="manYear" HeaderText="Manufacture Year" ReadOnly="true"/>
                <asp:BoundField DataField="colour" HeaderText="Vehicle Colour" ReadOnly="true"/> 
                <asp:BoundField DataField="customerId" HeaderText="Customer Id" ReadOnly="true"/> 
                <asp:BoundField DataField="customerName" HeaderText="Rented To" ReadOnly="true"/> 
                <asp:BoundField DataField="issueDate" HeaderText="Date Issued" ReadOnly="true"/> 
                <asp:BoundField DataField="returnDate" HeaderText="Expected Return Date" ReadOnly="true"/> 
            </Fields>
            <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
        </asp:DetailsView>
        <asp:Label ID="lblVehicleRentalDetailsViewResult" runat="server"></asp:Label>
    </div>

</asp:Content>

<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="footerPlaceHolder">
</asp:Content>

